import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

import { TabsPage } from '../tabs/tabs';

export interface Slide {
  title: string;
  description: string;
  image: string;
}

@Component({
  selector: 'page-tutorial',
  templateUrl: 'tutorial.html'
})
export class TutorialPage {
  slides: Slide[];  //滑动的画面
  showSkip = true;  //是否显示跳过按钮

  constructor(public navCtrl: NavController) {
    this.slides = [
      {
        title: "page1",
        description: "page1 desc",
        image: 'assets/images/ica-slidebox-img-1.png',
      },
      {
        title: "page2",
        description: "page2 desc",
        image: 'assets/images/ica-slidebox-img-1.png',
      },
      {
        title: "page3",
        description: "page3 desc",
        image: 'assets/images/ica-slidebox-img-1.png',
      }
    ];
  }

  startApp() {
    this.navCtrl.setRoot(TabsPage, {}, {
      animate: true,
      direction: 'forward'
    });
  }

  onSlideChangeStart(slider) {
    this.showSkip = !slider.isEnd;
  }
}
